﻿using SC;
using System;
using System.Collections.Generic;
using System.ComponentModel;
using System.Data;
using System.Drawing;
using System.Linq;
using System.Net.Sockets;
using System.Text;
using System.Threading.Tasks;
using System.Windows.Forms;

namespace WJSocket
{
    public partial class Form1 : Form
    {
        public Form1()
        {
            InitializeComponent();
        }
        SCServer scServer;

        private void Form1_Load(object sender, EventArgs e)
        {
            scServer = new SCServer("192.168.0.232", 8088)
            {
                scRecvEvent = RecvEvent
            };
        }

        void RecvEvent(Socket socketSend, MessageType messageType, byte[] data)
        {
            Console.WriteLine(data.Length);
            scServer.Send(MessageType.BeginTask, "开始");
            scServer.SendStream(MessageType.Stream, new byte[] { 0x01,0x02});
        }
    }
}
